<HTML><HEAD><TITLE>flush(+Stream)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Stream I/O</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>flush(+Stream)</H1>
Flushes the output stream Stream.


<DL>
<DT><EM>Stream</EM></DT>
<DD>Integer (stream number) or Atom (reserved or user-defined symbolic stream name).
</DD>
</DL>
<H2>Description</H2>
   Used to flush any data contained in the Stream buffer.

<P>
   Buffered output may need to be flushed e.g.  by writing again, by using
   flush/1, or by closing the stream.

<P>
   Stream can be a symbolic stream name (atom) or a physical stream number
   (integer).

<P>

<H3>Modes and Determinism</H3><UL>
<LI>flush(+) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Stream is not instantiated.
<DT><EM>(5) type error </EM>
<DD>Stream is instantiated neither to an integer nor an atom.
<DT><EM>(192) illegal stream mode </EM>
<DD>Stream is not an output stream.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      flush(output).
      flush(null).

      [eclipse]: pipe(in,out), write(out, 'q(a).\n'),
      &gt; flush(out), read(in,T).
      T = q(a).
      yes.

Error:
      flush(Stream).            (Error 4).
      flush("Stream").          (Error 5).
      flush(12).                (Error 192). % no such stream
      flush(debug_input).       (Error 192). % input stream



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/iostream/set_stream_property-3.html">set_stream_property / 3</A>, <A HREF="../../kernel/iostream/open-3.html">open / 3</A>, <A HREF="../../kernel/iostream/open-4.html">open / 4</A>, <A HREF="../../kernel/iostream/close-1.html">close / 1</A>, <A HREF="../../kernel/iochar/tyo-2.html">tyo / 2</A>
</BODY></HTML>
